Skip to content

[FEAT] Add swift concurrency target#95

Merged
hadiidbouk merged 1 commit intodevelopfrom
feat/add-swift-concurrency-target
Jan 23, 2026
Merged

[FEAT] Add swift concurrency target#95
hadiidbouk merged 1 commit intodevelopfrom
feat/add-swift-concurrency-target

Conversation

@hadiidbouk
Copy link
Copy Markdown
Collaborator

@hadiidbouk hadiidbouk commented Jan 19, 2026

Goals ⚽

Introduce a new FueledSwiftConcurrency target providing utilities for Swift's async/await concurrency model

Backwards-compatibility:

⚠️ 🚨 THIS WILL BREAK THE IMPORTS OF THE NEW TARGETS BECAUSE THEY DON'T HAVE UTILS IN THEM (e.g FueledUtilsCore -> FueledCore) 🚨⚠️

Implementation Details 🚧

  • Remove the Utils word from all the targets!
  • Created FueledSwiftConcurrency as a new library target with dependencies on AsyncAlgorithms and ConcurrencyExtras

Core Utilities Added:

  • AsyncSemaphore - An async-compatible counting semaphore for controlling concurrent access to shared resources. Supports both regular and cancellation-aware waiting.
  • CurrentValueAsyncSubject - A thread-safe subject that holds a current value and broadcasts changes, similar to Combine's CurrentValueSubject but designed for async/await.
  • BroadcastStream - A thread-safe broadcast stream that emits values to multiple subscribers, with optional replay of the last emitted value.
  • BufferedStream - A buffered async stream that stores emitted values and replays them to new consumers, useful for late subscribers.
  • AsyncCache - An actor-based asynchronous cache for storing key-value pairs with lazy computation and thread-safe access.

AsyncSequence Extensions:

  • takeUntil(_:) - Takes elements from a sequence until a condition is met
  • timeout(for:clock:tolerance:throwing:alwaysFinishAfterTimeout:) - Applies timeout behavior to async sequences with configurable error handling

AsyncStream Extensions:

  • timeout(after:) - Creates a stream that completes after a specified duration
  • flatMapOptional(_:) - Transforms elements into optional streams and flattens the result
  • promoteOptional() - Wraps each emitted value in an optional
  • single(value:) - Static factory for creating a stream that emits a single value

Testing Details 🔍

All tests have been added ✅

@hadiidbouk hadiidbouk force-pushed the feat/add-swift-concurrency-target branch 2 times, most recently from 788f55e to a573fa2 Compare January 19, 2026 14:13
@hadiidbouk hadiidbouk changed the base branch from chore/project-enhancements to develop January 23, 2026 12:48
@hadiidbouk hadiidbouk force-pushed the feat/add-swift-concurrency-target branch from a573fa2 to 2d7e8ab Compare January 23, 2026 12:48
@hadiidbouk hadiidbouk force-pushed the feat/add-swift-concurrency-target branch from 2d7e8ab to a2a16dc Compare January 23, 2026 12:49
@hadiidbouk hadiidbouk merged commit e4216d2 into develop Jan 23, 2026
1 check passed
@hadiidbouk hadiidbouk deleted the feat/add-swift-concurrency-target branch January 23, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants